package org.tgcloud.group.web.controller.manager.process.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Author: zhy
 * @Created: 2025-08-19-上午9:42
 * @Description:
 */
@Getter
@AllArgsConstructor
public enum ProcessEnum {

    createProject(101, "(%s)创建了项目"),
    editProject(103, "(%s)修改了项目"),
    delProject(104, "(%s)删除了项目"),
    pushOrder(201, "(%s)上传了表单"),
    cancelOrder(202, "(%s)作废了订单"),
    sureCheckOrder(203, "(%s)确认了核价"),
    submitCheckOrder(204, "(%s)提交了核价"),
    ;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProcessEnum::getType).toArray();

    /**
     * 方式
     */
    private final Integer type;
    /**
     * 值
     */
    private final String value;

    public static ProcessEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(mode -> mode.getType().equals(value), ProcessEnum.values());
    }

}
